package com.qf.application.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.qf.application.entity.Menu;
import org.apache.ibatis.annotations.Select;

public interface MenuMapper extends BaseMapper<Menu> {

    @Select("SELECT\n" +
            "\tm.*, ifnull(pm.url_name,'根节点') as pname\n" +
            "FROM\n" +
            "\tt_menu m\n" +
            "LEFT JOIN t_menu pm ON (m.pid = pm.id)\n" +
            "WHERE\n" +
            "\tm.id = #{id}")
    Menu info(Integer id);
}
